package test

import "GoServer/utils/debug"

func Main() {
	debug.Logln(debug.Debug, "这是一个测试程序")

	data := TestBasic{
		UserId: "007",
		Amount: 123,
	}
	processOrder(data)

	debug.Logln(debug.Debug, "当前金额：", data.Amount)

	processOrderPointer(&data)

	debug.Logln(debug.Debug, "当前金额：", data.Amount)
}

func processOrder(order TestBasic) {
	// 处理订单（复制一份数据）
	order.Amount = 100
	debug.Logln(debug.Debug, "processOrder 修改金额：", order.Amount)
}

func processOrderPointer(order *TestBasic) {
	// 处理订单（直接修改原数据）
	order.Amount = 100
	debug.Logln(debug.Debug, "processOrderPointer 修改金额：", order.Amount)
}
